package bean;

import javax.json.bind.annotation.JsonbNumberFormat;
import javax.json.bind.annotation.JsonbProperty;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;

@Entity
public class Message {

    // 为了使用jsonb,必须有一个空的默认构造方法
    public Message() {

    }

    public Message( String name, String email, String password,String phone,String img, User info) {

        this.name = name;
        this.email = email;
        this.password = password;
        this.phone = phone;
        this.img = img;
        this.info = info;
    }
    @Id
    @JsonbProperty("name")
    private String name;

    @OneToOne
    private User info;

    @JsonbProperty("phone")
    private String phone;

    @JsonbProperty("email")
    private String email;


    @JsonbProperty("password")
    private String password;

    @JsonbProperty("img")
    private String img;



    @JsonbNumberFormat(locale = "en_US", value = "#0.0")


    public String getname() {
        return name;
    }

    public void setname(String name) {
        this.name = name;
    }


    public User getInfo() {
        return info;
    }

    public void setInfo(User info) {
        this.info = info;
    }

    public String getimg() {
        return img;
    }

    public void setimg(String img) {
        this.img = img;
    }

    public String getPhone() {
        return phone;
    }

    public void setphone(String phone) {
        this.phone = phone;
    }


    public String gete_mail() {
        return email;
    }

    public void sete_mail(String e_mail) {
        this.email = email;
    }

    public String getpassword() {
        return password;
    }

    public void setpassword(String password) {
        this.password = password;
    }


}
